import request from '@/utils/request'

const api = {
  getKpiUnitUrl: '/kpi_config/get_kpiunit',
  getKpiDingeUrl: '/kpi_config/get_kpi_dinge',
  get_tagop: '/kpi_config/get_tagop',
  get_taginv: '/kpi_config/get_taginv',
  getTagInvPageUrl: '/kpi_config/get_taginv_page',
  addTaginvUrl: '/kpi_config/add_taginv',
  updateTaginvUrl: '/kpi_config/update_taginv',
  getMeasdocPageUrl: '/kpi_config/get_measdoc_page',
  updateKpiDingeUrl: '/kpi_config/update_kpi_dinge',
  wangongTotalKpiUrl: '/kpi_report/wangong_total_kpi',
  addKpiDingeUrl: '/kpi_config/add_kpi_dinge',
  removeKpiDinge: '/kpi_config/remove_kpi_dinge',
  kpiForUserUrl: '/kpi_report/kpi_for_user',
  getInvJxUrl: '/base_inv/get_invjx',
  getKpiReportUrl: '/kpi_report/get_kpi_report',
  wangongTotalKpiOwUrl: '/kpi_report/wangong_total_kpi_ow',
}
export async function wangongTotalKpiOwApi(params: Map<string, any>) {
  const res = await request({
    url: api.wangongTotalKpiOwUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getKpiReportApi(params: Map<string, any>) {
  const res = await request({
    url: api.getKpiReportUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function kpiForUserApi(params: Map<string, any>) {
  const res = await request({
    url: api.kpiForUserUrl,
    method: 'post',
    data: params,
  })
  return res
}
export async function removeKpiDingeApi(params: Map<string, any>) {
  const res = await request({
    url: api.removeKpiDinge,
    method: 'get',
    params,
  })
  return res
}

export async function addKpiDingeApi(params: Map<string, any>) {
  const res = await request({
    url: api.addKpiDingeUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function wangongTotalKpiApi(params: Map<string, any>) {
  const res = await request({
    url: api.wangongTotalKpiUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function updateKpiDingeApi(params: Map<string, any>) {
  const res = await request({
    url: api.updateKpiDingeUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getTagInvPageApi(params: Map<string, any>) {
  const res = await request({
    url: api.getTagInvPageUrl,
    method: 'get',
    params,
  })
  return res
}
export async function addTaginvApi(params: Map<string, any>) {
  const res = await request({
    url: api.addTaginvUrl,
    method: 'post',
    data: params,
  })
  return res
}
export async function updateTaginvApi(params: Map<string, any>) {
  const res = await request({
    url: api.updateTaginvUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getMeasdocPageApi(params: Map<string, any>) {
  const res = await request({
    url: api.getMeasdocPageUrl,
    method: 'get',
    params,
  })
  return res
}

export async function getKpiDingeApi(params: Map<string, any>) {
  const res = await request({
    url: api.getKpiDingeUrl,
    method: 'post',
    data: params,
  })
  return res
}

export async function getTagop(params: Map<string, any>) {
  const res = await request({
    url: api.get_tagop,
    method: 'get',
    params,
  })
  return res
}

export async function getTaginv(params: Map<string, any>) {
  const res = await request({
    url: api.get_taginv,
    method: 'get',
    params,
  })
  return res
}

export async function getKpiUnitApi(params: Map<string, any>) {
  const res = await request({
    url: api.getKpiUnitUrl,
    method: 'get',
    params: params,
  })
  return res
}
